<template>
	<view class="content">
		<!-- 头像 -->
		<view class="avatar" v-if="userInfo.headIcon">
			<image :src='userInfo.headIcon' mode="aspectFill"></image>
		</view>
		<view class="avatar" v-else>
			<image src='../../static/imgs/face/2jpg.jpg' mode="aspectFill"></image>
		</view>
		<view class="name">
			<view class="name-title" v-if="userInfo.nickName">
				<text>{{userInfo.nickName}}你好！</text>
			</view>
			<view class="name-title" v-else>
				<text @click="goLogin">请登录....</text>
			</view>
			<view class="name-info">
				<text>欢迎登录智慧门户系统,请进行人脸验证</text>
			</view>
		</view>
		<!-- 扫脸 -->
		<view class="sleep">
			<view class="sleep-img">
				 <image src="../../static/imgs/face/1.png" mode="aspectFit"></image>
			</view>
			<view class="sleep-text">
				<text>点击进行人脸识别</text>
			</view>
		</view>
		
		<!-- 登录方式 -->
		<view class="login-type">
			<view class="login-type-list">
				<view class="login-type-list-img">
					<image src="../../static/imgs/login/sl.png" mode="aspectFit"></image>
				</view>
				<view class="login-type-list-text">
					<text>刷脸登录</text>
				</view>
			</view>
			<view class="login-type-list">
				<view class="login-type-list-img">
					<image src="../../static/imgs/login/wb.png" mode="aspectFit"></image>
				</view>
				<view class="login-type-list-text">
					<text>一键登录</text>
				</view>
		
			</view>
			<view class="login-type-list">
				<view class="login-type-list-img">
					<image src="../../static/imgs/login/wxpng.png" mode="aspectFit"></image>
				</view>
				<view class="login-type-list-text">
					<text>微信登录</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getStorage} from '../../utility/local.js'
	export default {
		data() {
			return {
				userInfo:{}
			};
		},
		onShow() {
			this.userInfo = getStorage()
			console.log(this.userinfo)
		},
		methods:{
			goLogin(){
				uni.navigateTo({
					url:'/pages/login/login',
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		padding:40rpx 60rpx;
		box-sizing: border-box;
	}
	.avatar{
		margin-bottom: 40rpx;
		image{
			width: 100rpx;
			height: 100rpx;
			box-sizing: border-box;
			border-radius: 50%;
		}
	}
	.name-title{
		text{
			font-size: 56rpx;
			font-weight: 700;
		}
	}
	.name-info{
		text{
			color: #797979;
			font-size: 24rpx;
		}
	}
	.sleep{
		text-align: center;
		margin-top: 60rpx;
	}
	.sleep-text{
		text{
			font-size: 24rpx;
			color: #797979;
		}
	}
	.login-type{
		margin-top: 400rpx;
		display: flex;
		justify-content: space-between;
		.login-type-list{
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			.login-type-list-img{
				
				image{
					width: 86rpx;
					height: 86rpx;
				}
			}
			
			.login-type-list-text{
				text{
					display: inline-block;
					font-size: 24rpx;
				}
			}
		}
	}
</style>
